package de.lns.render;

public class RenderQueue implements Renderable {
	Iterable<Renderable> renderStack;
	
	public RenderQueue(Iterable<Renderable> stack) {
		renderStack = stack;
	}
	
	protected final void render() {
		int i = 0;
		for(Renderable r: renderStack){
			if(r instanceof Drawable){
				((Drawable)r).model().render();
				
			} 
			if(r instanceof MultiDraw){
				((MultiDraw)r).queue().render();
				
			} else if(r instanceof RenderQueue && r != this) {
				((RenderQueue)r).render();
			}
		}
	}
}
